package model

type User struct {
	ID       int64  `json:"id" form:"id" gorm:"column:id"`
	Name     string `json:"name" form:"name" gorm:"column:name;type:varchar(60);not null;comment:'用户名'"`
	Password string `json:"password" form:"password" gorm:"column:password;type:varchar(20);not null;comment:'密码'"`
	Age      int    `json:"age" form:"age" gorm:"column:age;type:int(11);not null;comment:'年龄'"`
	Gender   int8   `json:"gender" form:"gender" gorm:"column:gender;type:tinyint(4);not null;comment:'性别0-男1-女'"`
	Phone    string `json:"phone" form:"phone" gorm:"column:phone;type:varchar(20);NOT NULL;comment:'手机号'"`
	Deleted  int8   `json:"deleted" form:"deleted" gorm:"column:deleted;type:tinyint(4);NOT NULL;default:0;comment:'状态0-正常1-删除'"`
}

func (User) TableName() string {
	return "user_gorm"
}

func (user User) IsEmpty() bool {
	return user == (User{})
}
